project(benchmark-helper)

include_directories(include)

set(NAMESPACE idx/benchmark/)
set(HDR_NAMESPACE ${CMAKE_CURRENT_SOURCE_DIR}/include/${NAMESPACE})

set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/Benchmark.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/BenchmarkBaseEvent.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/BenchmarkConfiguration.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/BenchmarkCommandlineHelper.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/BenchmarkEvent.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/BenchmarkEventExecutor.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/BenchmarkEventList.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/BenchmarkEventListBackingBufferSizeEstimator.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/BenchmarkEventReader.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/BenchmarkEventReaderException.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/BenchmarkEventTypeId.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/BenchmarkEventTypeIdToEventTypeMapping.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/BenchmarkLineReader.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/BenchmarkResult.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/BenchmarkResult.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/ContentReader.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/ContinuosBuffer.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/DatFile.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/DatFileBenchmark.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/DatFileBenchmarkCommandlineHelper.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/DatFileBenchmarkConfiguration.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/InsertEvent.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/LookupEvent.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/PAPIHelper.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/ScanEvent.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/SpecificEventProcessor.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/StringBenchmark.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/StringBenchmarkCommandlineHelper.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/StringBenchmarkConfiguration.hpp)
set(benchmark-helpers-HEADERS ${benchmark-helpers-HEADERS} ${HDR_NAMESPACE}/UpdateEvent.hpp)

add_library(benchmark-helpers-lib INTERFACE)

target_sources(benchmark-helpers-lib INTERFACE ${benchmark-helpers-HEADERS})

target_include_directories(benchmark-helpers-lib INTERFACE ${Hana_INCLUDE_DIRS})
target_include_directories(benchmark-helpers-lib INTERFACE "${PROJECT_SOURCE_DIR}/include")

target_link_libraries(benchmark-helpers-lib INTERFACE utils-lib content-helpers-lib map-helpers-lib pthread TBB::tbb)

if(USE_COUNTERS)
    target_link_libraries(benchmark-helpers-lib INTERFACE profile-lib)
endif(USE_COUNTERS)
